﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="frmListadoVentas.aspx.cs" Inherits="PharmacyWeb.Ventas.frmListadoVentas" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="FeaturedContent" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server"><asp:Panel ID="Panel2" runat="server"><b>.: Liz Vigo:.</b> <br/> <h5>Ingrese Aquí su criterio de Búsqueda</h5></asp:Panel>
    <div class="panel panel-info">        
        <div class="panel-heading"><h3>Listado de Ventas</h3></div>
        <div class="panel-body">
            <label>Criterio:</label>
            <asp:TextBox runat="server" ID="txtCriterio"></asp:TextBox>
            <ajaxToolkit:BalloonPopupExtender runat="server" BalloonPopupControlID="Panel2" BalloonStyle="Cloud" ExtenderControlID="" CustomCssUrl="" DynamicServicePath="" Enabled="True" TargetControlID="txtCriterio" ID="txtCriterio_BalloonPopupExtender"></ajaxToolkit:BalloonPopupExtender>
            <asp:Button runat="server" ID="btnBuscar" Text="Buscar" CssClass="btn btn-primary"/>
            <div class="col-lg-12">
                <div class="col-lg-4"></div>
                <div class="col-lg-4"></div>
                <div class="col-lg-4">
                    <a class="btn btn-success" href="frmVenta.aspx?accion=nuevo">Nueva Venta</a>
                </div>
            </div>
            <asp:GridView runat="server" CssClass="table table-striped table-hover" ID="gvVenta" DataSourceID="odssVentas" AutoGenerateColumns="False">
                <Columns>
                    <asp:BoundField DataField="Id" HeaderText="Codigo" SortExpression="Id" />
                    <asp:BoundField DataField="FechaVenta" HeaderText="Fecha Venta" SortExpression="FechaVenta" />
                    <asp:BoundField DataField="Total" HeaderText="Total" SortExpression="Total" />
                    <asp:BoundField DataField="Cliente.Nombres" HeaderText="Cliente" SortExpression="IdCliente" />
                    <asp:TemplateField>
                        <HeaderTemplate>
                            Accion
                        </HeaderTemplate>
                        <ItemTemplate>
                            <a href='frmVenta.aspx?accion=editar&id=<%# Eval("Id") %>'>Editar</a> |
                            <a href='frmListadoVentas.aspx?accion=delete&id=<%# Eval("Id") %>' onclick="return confirm('Desea eliminar esta VENTA?');">Eliminar</a>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>                
            </asp:GridView>
            
            <asp:ObjectDataSource ID="odssVentas" runat="server" SelectMethod="GetVentasByCriterio" TypeName="PharmacyService.VentaService" OnObjectCreating="odssVentas_ObjectCreating">
                <SelectParameters>
                    <asp:ControlParameter ControlID="txtCriterio" Name="criterio" PropertyName="Text" Type="String" />
                </SelectParameters>
            </asp:ObjectDataSource>
            
        </div>
        <div></div>
    </div>
</asp:Content>
